<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="fck" %>
<%@page import="java.util.*,model.*,util.*,control.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../../css/base.css" rel="stylesheet" type="text/css" />
<link href="../../css/common.css" rel="stylesheet" type="text/css" />
<link href="../../css/pages_jiaxiaotong.css" rel="stylesheet" type="text/css" />
<link href="../../css/alert.css" rel="stylesheet" type="text/css" />
<title>学生情况</title>
</head>
<body>
<div id="layer_bgImg"></div>
<div id="container_main">
<span id="position">首页>>在线考试</span>
<div  id="container_menu_out">
  <div id="container_menu">
    <div class="left_menu_top">
      <p><a href="problem_list.jsp">试题列表</a></p>
      <p><a href="problem_add.jsp">添加题目</a></p>
      <p><a href="student_list.jsp">学生列表</a></p>
      <p><a href="problem_status_list.jsp">查看题目使用情况</a></p>
      <p><a href="score_list.jsp">查看学生成绩</a></p>
      <p><a href="answerlog_list.jsp">查看答题情况</a></p>
      <p><a href="../../index.jsp">退出登录</a></p>
    </div>
  </div>
</div>
<div id="container_displayArea">
  <div class="main_title words_yahei_gray_normal_16">&nbsp;</div>
  <h1 class="H1_title_introduce">
    <%
           /***********************************************************************************/
           /*
           *验证权限
           *author 胡瑾
           *data 2011-12-08
           */
			String flag = (String)session.getAttribute("flag");
			String userId = (String)session.getAttribute("userId");
			int adminId = Integer.parseInt(userId);
						
			if (flag != "admin"|| flag == null )
			{
				%>
    <script language="javascript">
				     alert("您没有管理员权限,请重新登录"); window.location.href="../../index.jsp";
				    </script>
    <%
				
			}else{
				Admin admin = new Admin();
				AdminControl ac = new AdminControl();
				admin = ac.GetAdmin(adminId);
				out.print("<p>"+admin.getName()+"   欢迎您</p>");
				
			}
			/*********************************************************************************/
           %>
  </h1>
  <div> <br>
    <br>
    <!--这个from控制了分页!!!-->
    <form method="post">
      <table width="1056" border="0" align="center"  bgcolor="#000000">
        <tr bgcolor="#FFFFFF" align="center">
          <td><div align="left">序号</div></td>
          <td><div align="left">学号</div></td>
          <td><div align="left">考试时间</div></td>
          <td><div align="left">进入IP</div></td>
          <td><div align="left">是否在线</div></td>
          <td><div align="left">是否交卷</div></td>
          <td><div align="left">已经考试</div></td>
          <td><div align="left">交卷</div></td>
          <td><div align="left">备用</div></td>
          <td><div align="left">&nbsp</div></td>
          <td><div align="left">&nbsp</div></td>
        </tr>
        <%
		int k = 0;
		request.setCharacterEncoding("utf-8");
		int pages = ParamUtil.getInt(request,"pages",1);
		int rowsPerPage = ParamUtil.getInt(request,"pageSize",20);
	    Fettle fettle = new Fettle();
		FettleControl pc = new FettleControl();
		
		
		
		List<Fettle>list = new ArrayList<Fettle>();
		list = (List)pc.GetFettle(pages,rowsPerPage);
		//problem = pc.FettleScore(list.size());
		for(int i = 0; i<list.size();i++)
		{
			fettle = list.get(i);
			k++;
	%>
        <tr bgcolor="#FFFFFF">
          <td><%=k %></td>
          <td><%=fettle.getBtime()%></td>
          <td><%=fettle.getIp() %></td>
          <td><%=fettle.getOnline() %></td>
          <td><%=fettle.getEnd() %></td>
          <td><%=fettle.getUtime() %></td>
          <td><%=fettle.getFlag() %></td>
          <td><%=fettle.getAlt1() %></td>
          <td width ="5%" align = "center"><a href="../../fettle_update.jsp?id=<%=fettle.getStudentId()%>">修改</a></td>
          <td width ="5%" align = "center"><a href="../../fettle_del.jsp?id=<%=fettle.getStudentId()%>">删除</a></td>
        </tr>
        <%
	    } 
	    %>
      </table>
      <div align="center"> <br>
        <%
		out.println(FettleControl.pageInstance.getToolsMenu(pages));
		%>
        <br>
        <input type="button" value="添加总结" onClick="window.location.href='Fettle_add.jsp'">
        <input type="button" value="返回首页" onClick="window.location.href='../index.jsp'">
      </div>
    </form>
    <p class="P_wrapper_signIn">&nbsp;</p>
  </div>
  <!--	显示区域	END-->
  <!--清除浮动-->
  <div class="clear_both"></div>
</div>
</body>
</html>
